<?php
// vim: set ts=4 sw=4 sts=4 et:

/**
 * LiteCommerce
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to licensing@litecommerce.com so we can send you a copy immediately.
 *
 * @category   LiteCommerce
 * @package    XLite
 * @subpackage Model_Proxy
 * @author     Creative Development LLC <info@cdev.ru>
 * @copyright  Copyright (c) 2011 Creative Development LLC <info@cdev.ru>. All rights reserved
 * @license    http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
 * @link       http://www.litecommerce.com/
 * @see        ____file_see____
 * @since      1.0.0
 */

namespace XLite\Model\Proxy;

/**
 * THIS CLASS WAS GENERATED BY THE DOCTRINE ORM. DO NOT EDIT THIS FILE
 *
 * @package    XLite
 * @see        ____class_see____
 * @since      1.0.0
 */
class XLiteModelOrderItemSurchargeProxy extends \XLite\Model\OrderItem\Surcharge implements \Doctrine\ORM\Proxy\Proxy
{
    /**
     * _entityClass
     *
     * @var    string
     * @access protected
     * @see    ____var_see____
     * @since  1.0.0
     */
    protected $_entityClass;

    /**
     * _entityPersister
     *
     * @var    mixed
     * @access private
     * @see    ____var_see____
     * @since  1.0.0
     */
    private $_entityPersister;

    /**
     * _identifier
     *
     * @var    mixed
     * @access private
     * @see    ____var_see____
     * @since  1.0.0
     */
    private $_identifier;

    /**
     * __isInitialized__
     *
     * @var    mixed
     * @access public
     * @see    ____var_see____
     * @since  1.0.0
     */
    public $__isInitialized__ = false;

    /**
     * __construct
     *
     * @param mixed $entityPersister ____param_comment____
     * @param mixed $identifier      ____param_comment____
     *
     * @return void
     * @access public
     * @see    ____func_see____
     * @since  1.0.0
     */
    public function __construct($entityPersister, $identifier)
    {
        $this->_entityPersister = $entityPersister;
        $this->_identifier = $identifier;
        $this->_entityClass = 'XLite\Model\OrderItem\Surcharge';
    }

    /**
     * _load
     *
     * @return void
     * @access private
     * @see    ____func_see____
     * @since  1.0.0
     */
    private function _load()
    {
        if (!$this->__isInitialized__ && $this->_entityPersister) {
            $this->__isInitialized__ = true;
            if ($this->_entityPersister->load($this->_identifier, $this) === null) {
                return;
            }
            unset($this->_entityPersister);
            unset($this->_identifier);
        }
    }

    
    public function getOrder()
    {
        $this->_load();
        return parent::getOrder();
    }

    public function getId()
    {
        $this->_load();
        return parent::getId();
    }

    public function setType($type)
    {
        $this->_load();
        return parent::setType($type);
    }

    public function getType()
    {
        $this->_load();
        return parent::getType();
    }

    public function setCode($code)
    {
        $this->_load();
        return parent::setCode($code);
    }

    public function getCode()
    {
        $this->_load();
        return parent::getCode();
    }

    public function setClass($class)
    {
        $this->_load();
        return parent::setClass($class);
    }

    public function getClass()
    {
        $this->_load();
        return parent::getClass();
    }

    public function setInclude($include)
    {
        $this->_load();
        return parent::setInclude($include);
    }

    public function getInclude()
    {
        $this->_load();
        return parent::getInclude();
    }

    public function setAvailable($available)
    {
        $this->_load();
        return parent::setAvailable($available);
    }

    public function getAvailable()
    {
        $this->_load();
        return parent::getAvailable();
    }

    public function setValue($value)
    {
        $this->_load();
        return parent::setValue($value);
    }

    public function getValue()
    {
        $this->_load();
        return parent::getValue();
    }

    public function setName($name)
    {
        $this->_load();
        return parent::setName($name);
    }

    public function setOwner(\XLite\Model\OrderItem $owner)
    {
        $this->_load();
        return parent::setOwner($owner);
    }

    public function getOwner()
    {
        $this->_load();
        return parent::getOwner();
    }

    public function getModifier()
    {
        $this->_load();
        return parent::getModifier();
    }

    public function getInfo()
    {
        $this->_load();
        return parent::getInfo();
    }

    public function getName()
    {
        $this->_load();
        return parent::getName();
    }

    public function map(array $data)
    {
        $this->_load();
        return parent::map($data);
    }

    public function __get($name)
    {
        $this->_load();
        return parent::__get($name);
    }

    public function __set($name, $value)
    {
        $this->_load();
        return parent::__set($name, $value);
    }

    public function __unset($name)
    {
        $this->_load();
        return parent::__unset($name);
    }

    public function getRepository()
    {
        $this->_load();
        return parent::getRepository();
    }

    public function checkCache()
    {
        $this->_load();
        return parent::checkCache();
    }

    public function detach()
    {
        $this->_load();
        return parent::detach();
    }

    public function __call($method, array $args = array (
))
    {
        $this->_load();
        return parent::__call($method, $args);
    }

    public function isPersistent()
    {
        $this->_load();
        return parent::isPersistent();
    }

    public function update()
    {
        $this->_load();
        return parent::update();
    }

    public function create()
    {
        $this->_load();
        return parent::create();
    }

    public function delete()
    {
        $this->_load();
        return parent::delete();
    }

    public function cloneEntity()
    {
        $this->_load();
        return parent::cloneEntity();
    }

    public function prepareEntityBeforeCommit()
    {
        $this->_load();
        return parent::prepareEntityBeforeCommit();
    }


    /**
     * __sleep
     *
     * @return void
     * @access public
     * @see    ____func_see____
     * @since  1.0.0
     */
    public function __sleep()
    {
        return array('__isInitialized__', 'owner', 'id', 'type', 'code', 'class', 'include', 'available', 'value', 'name');
    }

    /**
     * __wakeup
     *
     * @return void
     * @access public
     * @see    ____func_see____
     * @since  1.0.0
     */
    public function __wakeup()
    {
        if (isset($this->_identifier)) {
            foreach ($this->_identifier as $k => $v) {
                $this->$k = $v;
            }

            \Xlite\Core\Database::getEM()->getUnitOfWork()->removeFromIdentityMap($this);
            $this->_entityPersister = \XLite\Core\Database::getEM()->getUnitOfWork()->getEntityPersister($this->_entityClass);
        }
    }
}